POV-Ray : Newsgroups : povray.animations : A book with pages turning -- how to translate + scale a whole page made of 8 patches? : Re: A book with pages turning -- how to translate + scale a whole page made of 8 patches? Server Time
28 Jul 2024 18:17:22 EDT (-0400)
  Re: A book with pages turning -- how to translate + scale a whole page made of 8 patches?  
From: Eric Andersen
Date: 1 Mar 1999 18:46:55
Message: <36DB280A.A1BAE3E6@frontiernet.net>
forkazoo:

You could do something like this:

 Place=PVector;
 Scale=SVector;

loop
	define a page

	loop

	  bicubic_patch{ *stuff* 
		scale internal_scale*Scale 
		translate internal_place+Place}

end all the loops

will that do it?
you might need to declare the scale multiplication and translate
addition before you scale and translate the object.  Be sure to scale
first, then translate, or else you'll get wacky results.  This brings up
another point:you must define the patches in reference to the origin. 
When you translate the patches and then scale them down, they are pulled
toward the origin.  When you rotate an object, you rotate it about the
origin.  Therefore, you should usually define the object centered on the
origin, then scale it, then rotate it, then translate it.  (You can
interchange the order of scale and rotate as long as you are not doing
uneven scaling)

hope this helps.

-Eric

forkazoo wrote:
> 
> I want to have an open book with pages turning, like when they are being
> blown by the wind.
> 
> What I am doing is making a loop, each cycle of this loop makes a page.
> Inside of this, there is a loop that makes a few bicubic patches to
> represent a single page.  How do I translate, and scale all of the bicubic
> patches made by the inner loop at once.  Can I just encase the inner loop
> inside of a union statement, or something? I can't figure out how to do a
> transformation on a whole page (8 bicubic patches).  Please help!
> 
> Thank you!
> 
> P.S.  Ultimately, this animation will be all the PoV stuff that I don't
> quite understand -- atmospheric media, bicubic patches, and loops, and a few
> other things.  It will be interesting.  Did I mention the morphing rose
> stained glass window?


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.